package net.csdra.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletResponse;

/**
 * Created by msf on 2018/1/24.
 */
@Controller
public class LoginController {
    @RequestMapping("/login")
    public String login() {
        return "login";
    }

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public String login(UserLogin login, String successUrl, Model model, HttpServletResponse response) {
        return "redirect:" + successUrl;
    }
    class UserLogin {

        String userName;
        CharSequence password;

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public CharSequence getPassword() {
            return password;
        }

        public void setPassword(CharSequence password) {
            this.password = password;
        }
    }


}
